package com.oocl.struct;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Customer implements Comparable<Customer>,Cloneable{
	private int id;
	private String name;
	private String email;
	private boolean sex;
	private Date birthday;
	
	public Customer(int id, String name, String email, boolean sex,
			Date birthday) {
		super();
		this.id = id;
		this.name = name;
		this.email = email;
		this.sex = sex;
		this.birthday = birthday;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public boolean isSex() {
		return sex;
	}
	public void setSex(boolean sex) {
		this.sex = sex;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public int compareTo(Customer o) {
		// TODO Auto-generated method stub
		return this.id-o.id;
	}
	
	@Override
	public String toString() {
		String string = id+"\t"+name+"\t"+email+"\t"+sex+"\t"+new SimpleDateFormat("YYYY-MM-dd").format(birthday);
		return string;
	}

	@Override
	public Object clone() throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		return super.clone();
	}
	
}
